package com.gs.synedocket.model;


import com.gs.synedocket.apiresult.ApiResultData;
import com.gs.synedocket.constant.DbMsg;
import com.gs.synedocket.model.listener.OnResultListener;

import java.lang.reflect.Type;

public class SettingsModel {
    public void changeTruck(String truckId, final OnResultListener onResultListener, Type typeofT) {
//        OKHttpUtil.getInstance().getAsync(OKHttpUtil.NET_URL + "/api/users/switchTruck?truckId="+truckId,
//                new Callback() {
//                    @Override
//                    public void onSuccess(Object obj) {
//                        onResultListener.onSuccess(obj);
//                    }
//
//                    @Override
//                    public void onFailed(Exception e) {
//                        onResultListener.onFails(e);
//                    }
//                },typeofT);
        ApiResultData<Object> result = new ApiResultData<>();
        result.setStatus(2000);
        result.setMessage(DbMsg.UPDATE_SUCCESS);
        result.setData(null);
        onResultListener.onSuccess(result);
    }

    public void logOut(String id, final OnResultListener onResultListener, Type typeofT) {
//        OKHttpUtil.getInstance().getAsync(OKHttpUtil.NET_URL + "/api/users/logOut?userId="+id,
//                new Callback() {
//                    @Override
//                    public void onSuccess(Object obj) {
//                        onResultListener.onSuccess(obj);
//                    }
//
//                    @Override
//                    public void onFailed(Exception e) {
//                        onResultListener.onFails(e);
//                    }
//                },typeofT);
        ApiResultData<Object> result = new ApiResultData<>();
        result.setStatus(2000);
        result.setMessage(DbMsg.LOGOUT_SUCCESS);
        result.setData(null);
        onResultListener.onSuccess(result);
    }
}
